package com.mark.web.sys.entity.vo;

import com.mark.common.utils.DateTimeUtil;
import com.mark.web.sys.entity.po.Role;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * @Description: 角色Vo
 * @Author: Mark
 * @CreateDate: 2019/1/13 19:02
 * @Version: 2.0
 * @Copyright : 豆浆油条个人非正式工作室
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
public class RoleVo {
    /**
     * 主键ID
     */
    private Integer id;

    /**
     * 角色名
     */
    private String name;

    /**
     * 权重
     */
    private Short priority;

    /**
     * 描述
     */
    private String description;

    /**
     * 创建时间
     */
    private String createTime;

    /**
     * 上一次修改时间
     */
    private String lastEditTime;

    public RoleVo(Role role){
        this.id = role.getId();
        this.name = role.getName();
        this.priority = role.getPriority();
        this.description = role.getDescription();
        this.createTime = DateTimeUtil.dateToStr(role.getCreateTime());
        this.lastEditTime =DateTimeUtil.dateToStr(role.getLastEditTime());
    }
}
